﻿#pragma once
#include <string>
#include <set>
#include <memory>
#include "subscriber.h"

class SessionManager
{
public:
    static SessionManager& instance()
    {
        static SessionManager ins;
        return ins;
    }

	void join(Subscriber* subscriber);
	void leave(Subscriber* subscriber);
	void broadcast(const char *msg, int len); // broadcast to all client
private:

private:
    SessionManager(const SessionManager&) = delete;
    SessionManager& operator=(const SessionManager&) = delete;
    SessionManager() = default;
    ~SessionManager() = default;

	std::set<Subscriber*> _subscribers;
};